package dateclass;

/**
 * Created by L.jp
 * Description:
 * User: 86189
 * Date: 2022-10-05
 * Time: 16:29
 */
public class Test_StringToUtilDate {
    public static void main(String[] args) {
        //（1）String--->java.sql.Date
        //valueOf只局限于字符串是Y-M-D的形式才可以转换成Date类
        java.sql.Date date = java.sql.Date.valueOf("2015-9-24");
        //（2）java.sql.Date--->java.util.Date
        java.util.Date date2 = date;
        System.out.println(date2.toString());
    }
}
